Export symbols needed by Android drivers
authorBen Hutchings <ben@decadent.org.uk>
Mon, 7 Sep 2020 01:51:53 +0000 (02:51 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 20 Jan 2024 19:37:22 +0000 (20:37 +0100)
Bug-Debian: https://bugs.debian.org/901492

We want to enable use of the Android ashmem and binder drivers to
support Anbox, but they should not be built-in as that would waste
resources and increase security attack surface on systems that don't
need them.

Export the currently un-exported symbols they depend on.

Gbp-Pq: Topic debian
Gbp-Pq: Name export-symbols-needed-by-android-drivers.patch

fs/file.c
kernel/sched/core.c
kernel/sched/wait.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index 3e4a4dfa38fcadcc9c756b544f1fa47ad3197f46..bdded3fcdbd8746b4cdc33c2791e764c8c82d60d 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -816,6 +816,7 @@ struct file *close_fd_get_file(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index a854b71836dd5b8a811d098a0cc24a2381e1e727..abb473964b77c79672f348bab54055bf9868d1de 100644 (file)
@@ -7254,6 +7254,7 @@ static bool is_nice_reduction(const struct task_struct *p, const int nice)
 
        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 /*
  * can_nice - check if a task can reduce its nice value
index 802d98cf2de317aa601100f4b153aabc0bb236b3..8eec46f066d868fe8666d5089feaec398a178e94 100644 (file)
@@ -252,6 +252,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* POLLFREE must have cleared the queue. */
        WARN_ON_ONCE(waitqueue_active(wq_head));
 }
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
 
 /*
  * Note: we use "set_current_state()" _after_ the wait-queue add,
index 95a7e1b7f1dab2d3e5eef4b16e2cefe7f25f2f22..972c3280337e8f80be6acae4651b49469d9d4694 100644 (file)
@@ -73,6 +73,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(task_work_add);
 
 /**
  * task_work_cancel_match - cancel a pending work added by task_work_add()
index dccf9203dd5369354efb611b0fed7ace1495e557..7b186f678c4c4d79068ca3465538247edb8518fc 100644 (file)
@@ -1770,6 +1770,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        tlb_finish_mmu(&tlb);
        hugetlb_zap_end(vma, details);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index e826be732b9bbd38c545ec2ce80bae5bc24b547d..b4257ea8506b296678d96926e114401a452feeef 100644 (file)
@@ -4888,6 +4888,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(shmem_zero_setup);
 
 /**
  * shmem_read_folio_gfp - read into page cache, using specified page allocation flags.
index 23b129d482a7c8f478d4fe8a709c7f4a7ed47ab8..eeb7162a02674b8a4d9d258ec47872da3a9e289e 100644 (file)
@@ -799,6 +799,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, 0, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 /**
  * security_binder_transaction() - Check if a binder transaction is allowed
@@ -814,6 +815,7 @@ int security_binder_transaction(const struct cred *from,
 {
        return call_int_hook(binder_transaction, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 /**
  * security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -829,6 +831,7 @@ int security_binder_transfer_binder(const struct cred *from,
 {
        return call_int_hook(binder_transfer_binder, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 /**
  * security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -845,6 +848,7 @@ int security_binder_transfer_file(const struct cred *from,
 {
        return call_int_hook(binder_transfer_file, 0, from, to, file);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
 
 /**
  * security_ptrace_access_check() - Check if tracing is allowed